package com.gyf.dao;

import com.gyf.model.User;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class UserDaoImpl2 implements IUserDao{


    private JdbcTemplate jdbcTemplate;

    public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
        this.jdbcTemplate = jdbcTemplate;
    }

    @Override
    public void add(User user) {
        System.out.println("dao 添加用户:" + user);

        jdbcTemplate.update("insert t_user (username,password) values (?,?)",user.getUsername(),user.getPassword());
    }
}
